package com.distribution.system.manager.channel;

import com.distribution.system.domain.bo.CmccDaUpChannelInfoBO;
import com.distribution.system.manager.channel.channelInfo.ChannelInfoManager;
import com.distribution.system.manager.channel.impl.*;
import org.springframework.stereotype.Service;

/**
 * @author Liping Huo
 * @date 2023/5/23 1:12
 */
@Service
public class ChannelManager {

    private final ChannelInfoManager channelInfoManager;

    public ChannelManager(ChannelInfoManager channelInfoManager) {
        this.channelInfoManager = channelInfoManager;
    }

    public Channel getDefaultChannel(Integer trilateralId) {
        CmccDaUpChannelInfoBO cmccDaUpChannelInfoBO = channelInfoManager.getChannelInfoById(trilateralId);
        if (trilateralId == 102) {
            return new YingJiaoChannel(cmccDaUpChannelInfoBO);
        }
        if (trilateralId == 103) {
            return new WangHuiMingChannel(cmccDaUpChannelInfoBO);
        }
        if (trilateralId == 104) {
            return new SanJianKeChannel(cmccDaUpChannelInfoBO);
        }
        if (trilateralId == 105) {
            return new FlowChannel(cmccDaUpChannelInfoBO);
        }
        if (trilateralId == 106) {
            return new QiuKuiChannel(cmccDaUpChannelInfoBO);
        }
        if (trilateralId == 107) {
            return new ChuanHeChannel(cmccDaUpChannelInfoBO);
        }
        if (trilateralId == 108) {
            return new OneSixEightChannel(cmccDaUpChannelInfoBO);
        }
        if (trilateralId == 109) {
            return new MaiZhongChannel(cmccDaUpChannelInfoBO);
        }
        if (trilateralId == 110) {
            return new AoYaChannel(cmccDaUpChannelInfoBO);
        }
        return new DefaultChannel(cmccDaUpChannelInfoBO);
    }
}
